#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_file.py
# author:张世航
# datetime:2024/11/12 21:41
# software: PyCharm
"""
练习:
   构造上述文件结构,分别在指定位置打开文件进行写入操作(同级文件夹里面打开;  同级目录下的子目录里面打开; 上一级文件目录中的其他文件夹中打开);
"""
# import module your need

#绝对路径
with open(r"D:\文档\python\zhangshihang——python\B  exercise\exercise3\aa.txt", "r") as file:
   print(file.read())

# 同级文件夹里面打开
with open("aa.txt", "r") as file1:
    print(file1.read())

# 同级目录下的子目录里面打开
with open(r"B_file/bb.txt", "r") as file2:
    print(file2.read())

# 上一级文件目录中的其他文件夹中打开
with open(r"../filetest1/cc.txt", "r") as file3:
    print(file3.read())
